﻿<?xml version="1.0" encoding="utf-8"?>
<Content type="xform" name="EditContent">
  <model>
    <instance>
      <tblContent>
        <nContentKey/>
        <nContentPrimaryId/>
        <nVersion/>
        <cContentForiegnRef/>
        <cContentName/>
        <cContentSchemaName>Poll</cContentSchemaName>
        <cContentXmlBrief>
          <Title/>
          <Description/>
          <Images>
            <img class="detail"/>
          </Images>
          <dOpenDate/>
          <dCloseDate/>
          <Resulting public="true" display="voted">
            <VoteConfirmationMessage>Thank You, your vote has been submitted</VoteConfirmationMessage>
          </Resulting>
          <Restrictions>
            <Frequency>once</Frequency>
            <RegisteredVotersOnly>false</RegisteredVotersOnly>
            <Identifiers>cookies</Identifiers>
          </Restrictions>
        </cContentXmlBrief>
        <cContentXmlDetail/>
        <nAuditId/>
        <nAuditKey/>
        <dPublishDate/>
        <dExpireDate/>
        <dInsertDate/>
        <nInsertDirId/>
        <dUpdateDate/>
        <nUpdateDirId/>
        <nStatus>1</nStatus>
        <cDescription/>
      </tblContent>
    </instance>
    <submission id="EditContent" action="" method="post" event="return form_check(this)"/>
    <bind nodeset="tblContent">
      <bind id="cContentName" nodeset="cContentName" required="true()" type="string"/>
      <bind id="dPublishDate" nodeset="dPublishDate" required="false()" type="string"/>
      <bind id="dExpireDate" nodeset="dExpireDate" required="false()" type="string"/>
      <bind id="nStatus" nodeset="nStatus" required="true()" type="string"/>
      <bind nodeset="cContentXmlBrief">
        <bind id="cContentName" nodeset="Title" required="true()" type="string"/>
        <bind id="Description" nodeset="Description" required="false()" type="string"/>
        <bind id="dOpenDate" nodeset="dOpenDate" required="false()" type="string"/>
        <bind id="dCloseDate" nodeset="dCloseDate" required="false()" type="string"/>
        <bind nodeset="Resulting">
          <bind id="bVotingPublic" nodeset="@public" required="true()" type="string"/>
          <bind id="bResultsDisplayed" nodeset="@display" required="true()" type="string"/>
          <bind id="bVoteConfirmationMessage" nodeset="VoteConfirmationMessage" required="false()" type="string"/>
        </bind>
        <bind nodeset="Restrictions">
          <bind id="cVotingFrequency" nodeset="Frequency" required="true()" type="string"/>
          <bind id="bRegisteredVoters" nodeset="RegisteredVotersOnly" required="true()" type="string"/>
          <bind id="cVotingRestrictions" nodeset="Identifiers" required="true()" type="string"/>
        </bind>

        <bind id="cContentFullSizePicture" nodeset="Images/img[@class='detail']" required="false()" type="xml-replace"/>
      </bind>
    </bind>
  </model>
  <group ref="EditContent" class="2col">
    <label>Edit Poll</label>
    <group>
      <group>
        <input bind="nContentKey" class="hidden">
          <label>ContentId</label>
        </input>
        <label>Settings</label>
        <input bind="dPublishDate" class="calendar short">
          <label>Publish Date</label>
        </input>
        <input bind="dExpireDate" class="calendar short">
          <label>Expire Date</label>
        </input>
        <select1 bind="nStatus" appearance="full" class="required vshort">
          <label>Status</label>

          <item>
            <label>Live</label>
            <value>1</value>
          </item>
          <item>
            <label>Hidden</label>
            <value>0</value>
          </item>
        </select1>
        <input bind="cContentFullSizePicture" class="short pickImage">
          <label>Image</label>
        </input>
      </group>
    </group>
    <group>
      <group>
        <label>Poll Details</label>
        <input bind="cContentName" class="required long">
          <label>Poll Title</label>
        </input>
        <input bind="Description" class="long">
          <label>Question</label>
        </input>
        <input bind="dOpenDate" class="calendar short">
          <label>Poll Open Date</label>
        </input>
        <input bind="dCloseDate" class="calendar short">
          <label>Poll Close Date</label>
        </input>
      </group>
      <group ref="relatedContent">
        <label>Poll Options</label>
        <relatedContent search="find add" type="PollOption" relationType=""   direction="2way">
          <label>PollOption</label>
        </relatedContent>
        <!-- BESPOKE FOR RIGHT 2 LEARN WHILST DEVELOPING - DELETE AFTER 1 MONTH - 2009-10-27 -->
        <!--<relatedContent type="CompetitionEntry" search="add find"/>-->
      </group>
      <group>
        <label>Results Options</label>
        <select1 bind="bVotingPublic" appearance="full" class="required">
          <label>Results are Public?</label>
          <item>
            <label>Yes</label>
            <value>true</value>
          </item>
          <item>
            <label>No</label>
            <value>false</value>
          </item>
        </select1>
        <select1 bind="bResultsDisplayed" appearance="full" class="required">
          <label>Results are Displayed?</label>
          <item>
            <label>Immediately after voting</label>
            <value>voted</value>
          </item>
          <item>
            <label>When closed</label>
            <value>closed</value>
          </item>
        </select1>
        <input bind="bVoteConfirmationMessage" class="long">
          <label>Vote confirmation message</label>
        </input>
      </group>
      <group>
        <label>Voting Restrictions</label>
        <select1 bind="cVotingFrequency" appearance="full" class="required">
          <label>How many times can a vote be cast?</label>
          <item>
            <label>Once only</label>
            <value>once</value>
          </item>
          <item>
            <label>Once every day</label>
            <value>daily</value>
          </item>
          <item>
            <label>Once every week</label>
            <value>weekly</value>
          </item>
          <item>
            <label>Once every month</label>
            <value>monthly</value>
          </item>
        </select1>
        <select1 bind="bRegisteredVoters" appearance="full" class="required">
          <label>Voters must be registered?</label>
          <item>
            <label>Yes</label>
            <value>true</value>
          </item>
          <item>
            <label>No</label>
            <value>false</value>
          </item>
          <hint>This only applies to sites with the Membership plugin.</hint>
        </select1>
        <select bind="cVotingRestrictions" appearance="full" class="checkboxes required">
          <label>Identify unregistered voters by</label>
          <item>
            <label>Cookies</label>
            <value>cookies</value>
          </item>
          <item>
            <label>E-mail address</label>
            <value>email</value>
          </item>
          <item>
            <label>IP Address</label>
            <value>ipaddress</value>
          </item>
          <hint>
            If unregistered votes are allowed, one or more of the options can be used:
            <ul>
              <li>Cookies are reliable but can be overridden by the voter.</li>
              <li>E-mail addresses are useful for gathering information, but may be fake, and there's nothing to stop someone using lots of made-up addresses.</li>
              <li>IP Addresses are reliable, but more than one person may share an IP address.  They can also be faked.</li>
            </ul>
            A recommended approach would be to use Cookies and at least one other option.
          </hint>
        </select>
      </group>
      <submit submission="" ref="ewSubmit" class="principle">
        <label>Save Poll</label>
      </submit>
    </group>
  </group>
</Content>